package com.atguigu.gulimall.auth.vo;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 注册用户视图
 *
 * @author DuGuanghan
 * @since 2024-08-21 15:27:25
 */
@Data
public class UserVO {
    /**
     * 用户名
     */
    @NotEmpty(message = "用户名不允许为空")
    @Size(min = 6, max = 12, message = "用户名需要在6-12位字符")
    private String username;
    /**
     * 密码
     */
    @NotEmpty(message = "密码不允许为空")
    @Size(min = 6, max = 12, message = "密码需要在6-12位字符")
    private String password;
    /**
     * 电话
     */
    @NotEmpty(message = "手机号不允许为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确，请重新输入")
    private String phone;
    /**
     * 验证码
     */
    private String code;
}
